package com.hsnn.medstgmini.base.dict.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.springframework.format.annotation.DateTimeFormat;

import com.hsnn.medstgmini.model.Status;
import com.hsnn.medstgmini.util.DateUtil;

/**
 * @category 自定义字典记录
 * @author 张俊
 * @date 2015-06-10
 */
@Entity
@Table(name = "dic_sysdic_log")
public class DicSysDicLog implements java.io.Serializable {

	// Fields

	private String logId;
	private String sysDicId;
	private String classifyCode;
	private String classifyName;
	private String dicCode;
	private String dicName;
	private String remark;
	private short status;
	private Date updDatetime;
	private String updUser;
	private short sortId;
	
	private String statusName;
	private String updDateTimeStr;
	private Date startTime;
	private Date endTime;

	// Constructors

	/** default constructor */
	public DicSysDicLog() {
	}

	/** minimal constructor */
	public DicSysDicLog(String sysDicId, String classifyCode,
			String classifyName, String dicCode, String dicName) {
		this.sysDicId = sysDicId;
		this.classifyCode = classifyCode;
		this.classifyName = classifyName;
		this.dicCode = dicCode;
		this.dicName = dicName;
	}

	/** full constructor */
	public DicSysDicLog(String sysDicId, String classifyCode,
			String classifyName, String dicCode, String dicName, String remark,
			short status, Date updDatetime, String updUser, short sortId) {
		this.sysDicId = sysDicId;
		this.classifyCode = classifyCode;
		this.classifyName = classifyName;
		this.dicCode = dicCode;
		this.dicName = dicName;
		this.remark = remark;
		this.status = status;
		this.updDatetime = updDatetime;
		this.updUser = updUser;
		this.sortId = sortId;
	}

	// Property accessors
	@Id
	@Column(name = "log_id")
	public String getLogId() {
		return this.logId;
	}

	public void setLogId(String logId) {
		this.logId = logId;
	}

	@Column(name = "sys_dic_id")
	public String getSysDicId() {
		return this.sysDicId;
	}

	public void setSysDicId(String sysDicId) {
		this.sysDicId = sysDicId;
	}

	@Column(name = "classify_code")
	public String getClassifyCode() {
		return this.classifyCode;
	}

	public void setClassifyCode(String classifyCode) {
		this.classifyCode = classifyCode;
	}

	@Column(name = "classify_name")
	public String getClassifyName() {
		return this.classifyName;
	}

	public void setClassifyName(String classifyName) {
		this.classifyName = classifyName;
	}

	@Column(name = "dic_code")
	public String getDicCode() {
		return this.dicCode;
	}

	public void setDicCode(String dicCode) {
		this.dicCode = dicCode;
	}

	@Column(name = "dic_name")
	public String getDicName() {
		return this.dicName;
	}

	public void setDicName(String dicName) {
		this.dicName = dicName;
	}

	@Column(name = "remark")
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "status")
	public short getStatus() {
		return this.status;
	}

	public void setStatus(short status) {
		this.status = status;
	}

	@Column(name = "upd_datetime")
	public Date getUpdDatetime() {
		return this.updDatetime;
	}

	public void setUpdDatetime(Date updDatetime) {
		this.updDatetime = updDatetime;
	}

	@Column(name = "upd_user")
	public String getUpdUser() {
		return this.updUser;
	}

	public void setUpdUser(String updUser) {
		this.updUser = updUser;
	}

	@Column(name = "sort_id")
	public short getSortId() {
		return this.sortId;
	}

	public void setSortId(short sortId) {
		this.sortId = sortId;
	}

	@Transient
	public String getStatusName() {
		statusName = Status.getName(status);
		return statusName;
	}

	public void setStatusName(String statusName) {
		this.statusName = statusName;
	}

	@Transient
	public String getUpdDateTimeStr() {
		if (updDatetime != null) {
			updDateTimeStr = DateUtil.date(updDatetime);
		}
		return updDateTimeStr;
	}

	public void setUpdDateTimeStr(String updDateTimeStr) {
		this.updDateTimeStr = updDateTimeStr;
	}

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Transient
	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Transient
	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	

}